package com.ayz.gateway.common.utils;

import cn.hutool.core.util.StrUtil;

import java.util.Arrays;
import java.util.List;

/**
 * @ClassName ServerAddressList
 * @Description TODO:服务端地址列表的List结构
 * @Author 快乐的星球
 * @Date 2023/6/3 14:47
 * @Version 1.0
 **/
public class ServerAddressList {

    public static List<String> generateAddressList(String serverAddresses){
        if(StrUtil.isBlank(serverAddresses)){
            throw new IllegalArgumentException("参数:{serverAddresses} 不能为空!");
        }
        String[] serverAddressArray = serverAddresses.split(",");
        return Arrays.asList(serverAddressArray);
    }
}
